package com.jch.Dao;

import com.entity.Comment;
import com.entity.Movie;


import java.util.List;

public class CommentDao extends BaseDao {
      public List<Comment> queryComment(){
          String sql="select * from comment";
          return findList(Comment.class,sql);
      }
    public int insertComment(Comment comment) {
        String sql = "insert into comment values(null,?,?,?,?)";
        Object[] params = {comment.getUid(),comment.getMid(),
        comment.getComment(),comment.getComtime()};
        return update(sql, params);
    }
    public List<Comment> queryCommentDesc(Object...params){
        String sql="SELECT * FROM comment where mid=? ORDER BY conid  DESC LIMIT 3 ";

        return findList(Comment.class,sql,params);


    }
}
